package com.cmict.data.infra.convert.message;

import com.cmict.data.framework.common.pojo.PageResult;
import com.cmict.data.infra.controller.admin.message.vo.AnnouncementDTO;
import com.cmict.data.infra.dal.dataobject.message.Announcement;
import com.cmict.data.infra.controller.admin.message.vo.AnnouncementPageVO;
import com.cmict.data.infra.controller.admin.message.vo.MyAnnouncementPageVO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

/**
 * @author Hccake 2020/12/16
 * @version 1.0
 */
@Mapper
public interface AnnouncementConverter {

	AnnouncementConverter INSTANCE = Mappers.getMapper(AnnouncementConverter.class);

	/**
	 * PO 转 PageVO
	 * @param announcement 公告表
	 * @return AnnouncementPageVO 公告表PageVO
	 */
	AnnouncementPageVO poToPageVo(Announcement announcement);

	/**
	 * AnnouncementDTO 转 Announcement实体
	 * @param dto AnnouncementDTO
	 * @return Announcement
	 */
	Announcement dtoToPo(AnnouncementDTO dto);


	PageResult<MyAnnouncementPageVO> pageToPageVoList(PageResult<Announcement> announcementPageResult);

}
